package com.woniu.his.mms.app.consumer;

import com.woniu.his.mms.app.consumer.dto.MedicineDto;

import com.woniu.his.mms.client.MedicineClient;
import lombok.extern.slf4j.Slf4j;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @version: java version 1.8
 * @Author: Mr Ni
 * @description:
 * @date: 2022-11-06 14:32
 */
@Component
@RocketMQMessageListener(topic = "hospital-Medicine-apply",consumerGroup = "woniu-84")
@Slf4j
public class MedicineClientConsumer implements RocketMQListener<MedicineDto> {

  @Resource
  private MedicineClient medicineClient;

    @Override
    public void onMessage(MedicineDto medicineDto) {
        log.info("延时消息处理{}:",medicineDto.getId());
        medicineClient.invalid(medicineDto.getId());
    }
}
